package com.jianyun.jyzs.http;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.view.View;

import com.jianyun.jyzs.MainActivity;
import com.jianyun.jyzs.constant.SysConstant;

/**
 * Created by yangshijun on 2018/9/29.
 */

public class MainActHandler extends Handler {

    private MainActivity act ;

    private MainActHandler(){
        super();
    }

    // 带有Looper参数的构造函数
    private MainActHandler(Looper L) {
        super(L);
    }

    /**
     * 本方法创建单例
     * @param activityProxy
     * @return
     */
    public MainActHandler(MainActivity act){
        this.act = act;
    }

    @Override
    public void handleMessage(Message msg) {
//        if(act.fragmentManager.findFragmentByTag("1") != null){
//            return;
//        }
//        int unreadCount = 0;
//        if(act.unread_app_number.isShown()){
//            try {
//                unreadCount = Integer.valueOf(act.unread_app_number.getText().toString().trim());
//            } catch (Exception e) {
//            }
//        }
//        if(SysConstant.tp_workFlowMsg == msg.what){
//            unreadCount += new WorkFlowCountDao(act).findAllUnRead(PreferrenceUtil.getPreferencesData(act, SysConstant.LOGIN_USER_SERVERID),PreferrenceUtil.getPreferencesData(act, SysConstant.LOGIN_ENTERPRISECODE));
//        }else{
//            unreadCount += 1;
//        }
//        act.unread_app_number.setVisibility(View.VISIBLE);
//        act.unread_app_number.setText(unreadCount > 999?"999":(unreadCount+""));
    }

}
